<template>
  <div class="box-contaion">
    <div>{{modalBranch}}</div>
    <div v-if="tableName">{{tableName}}</div>
  </div>
</template>

<script>
export default {
  name: "Modal",
  inject: ["getGraph", "getNode"],
  data() {
    return {
      modalBranch: '',
      tableName:''
    };
  },
  mounted() {
    const self = this;
    const node = this.getNode();
    this.modalBranch = node.data.branchName

    node.on("change:data", ({ current }) => {
      self.modalBranch = current.branchName;
      console.log('????')
      if(current && current.hasOwnProperty('tableName')){
        this.tableName = current.tableName
      }
    });
  },
}
</script>

<style scoped lang="scss">
.box-contaion{
  width: 200px;
  height: 70px;
  background: #fff;
  border-radius: 8px;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px #0a1e4129;
}
</style>
